package org.lsp.champs;

import java.awt.Image;
import java.util.ArrayList;

import org.lsp.io.logger.SysLogger;
import org.lsp.utils.CloneableImageIcon;

import res.SysRes;

public class Support implements Cloneable {

	private final String name;
	private final CloneableImageIcon icon;
	private final ArrayList<Support> counters = new ArrayList<>();

	protected Support(final String name_) {
		this.name = name_;
		this.icon = SysRes.championLogo(this.name);
	}

	protected final void addCounter(final String couName) {
		this.counters.add(ChampionManager.getChampionByName(couName));
	}

	@Override
	protected Object clone() {
		Support ret;
		try {
			return super.clone();
		} catch (final CloneNotSupportedException e) {
			SysLogger.log(e, "ERR13", SysLogger.Level.WARN);
			ret = new Support("");
		}
		return ret;
	}

	@SuppressWarnings("unchecked")
	public final ArrayList<Support> getCounters() {
		return ((ArrayList<Support>) this.counters.clone());
	}

	public final Image getIcon() {
		return this.icon.clone().getImage();
	}

	public final String getName() {
		return this.name;
	}

}
